// 对webpack的配置
// 打包编译         vue3 vite
const path = require("path");
const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
    transpileDependencies: true,
    lintOnSave: false,
    // 配置别名
    configureWebpack: (config) => {
        config.resolve.alias = {
            "@": path.resolve(__dirname, "src"),
            "@co": path.resolve(__dirname, "src/components")
        };
    },
    chainWebpack: (config) => {
        config.module
            .rule("scss")
            .test(/\.scss$/)
            .oneOf("vue")
            .use("px2rem-loader")
            .loader("px2rem-loader")
            .before("postcss-loader") // this makes it work.
            .options({
                remUnit: 75, //根据视觉稿，rem为px的⼗分之⼀，750px  75rem
                remPrecision: 8 //保留8位⼩数
            })
            .end();
    }
});

// vue里面的知识点   47网站.栏目模块 crud
// es6
// git
